using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace GrpcClient.Views
{
    /// <summary>
    /// TopThumb.xaml 的交互逻辑
    /// </summary>
    public partial class TopThumb : Window
    {
        public TopThumb()
        {
            InitializeComponent();
            Top = SystemParameters.PrimaryScreenHeight - 200;
            Left = SystemParameters.PrimaryScreenWidth - 200;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (App.Current.MainWindow.WindowState == WindowState.Minimized)
            {
                App.Current.MainWindow.WindowState = ResourceManager.Instance.LastState;
            }
            App.Current.MainWindow.Activate();
        }

        private void Button_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                try
                {
                    DragMove();
                }
                catch { }
            }
        }
    }
}
